package com.data;

import org.json.JSONObject;

import com.constant.Constant;
import com.net.AsyncRequest;
import com.net.ClientException;
import com.net.RequestParameter;
/**
 * 提交反馈消息
 * 提交参数为
 * <imei>
 * <content>
 * @author mjh
 *
 */
public final class FeedbackData extends BaseData {

	private boolean bSuccess;
	
	@Override
	public void startParse(RequestParameter parameter) throws Exception,
			ClientException {
		
		String rs = AsyncRequest.openUrl(Constant.SERVER_URL + "/feedback", AsyncRequest.HTTP_POST, parameter);
		if(rs == null)
			return;
		
		JSONObject json = new JSONObject(rs);
		String result = json.getString("result");
		if(result != null && result.equals("true"))
			bSuccess = true;
		else
			bSuccess = false;
	}
	
	public boolean getStatus() {
		return bSuccess;
	}
}
